<%- include common/header%>
  <body>
    <div id="wrap">
    <!-- start navbar -->
    <%- include common/navbar%>
	  <!--  ./end navbar -->
    <!--  昵称和心情 -->
     <div class="container text-center">
     	<h1><%=user.nickname%><p class="small"><span class="glyphicon glyphicon-flag"></span><%=user.moodsign%></p></h1>
     </div>
	 <div class="container">
	  <div class="row">
	     <div class="col-md-3">
  			 <!--  代办事情组 -->
  			 <%- include common/leftbar%>
         <!-- ./结束代办事情组 -->
       </div>
		 <div class="panel panel-danger col-md-9">
          <!-- Default panel contents -->
          <div class="panel-heading">
			<div class="panel-title">我的爱情日志列表</div>          
          </div>
          <div class="panel-body">
          	<!-- Table -->
          <table class="table table-striped table-responsive">
          <thead>
            <tr>
                <th>序号</th>
                <th>文章标题</th>
                <th>发表时间</th>
                <th>浏览量</th>
                <th>回复数</th>
                <th>顶</th>
                <th>踩</th>
                <th>状态</th>
                <th>管理</th>
            </tr>
            </thead>
            <tbody>
           <% if(bloglist.length==0){ %>
              <a href="javascript:void(-1);" class="love-group-item">
                 <h3 class="text-center" style="line-height:300px;">亲，你还没有发表爱情日志。<a href="/b/post">戳我</a>发一篇吧。</h3>
              </a>
           <% } 
            bloglist.forEach(function(blog,index){
           %>
              <tr>
              	<td><%=index+1%></td>
                <td><a href="/home/<%=blog._id%>"><%=ellipsis(blog.title,15)%></a></td>
                <td><%= dateformat(blog.posttime,'YYYY-MM-DD HH:mm:ss')%></td>
                <td><%=blog.pvnum%></td>
                <td><%=blog.replynum%></td>
                <td><%=blog.yesnum%></td>
                <td><%=blog.nonum%></td>
                <td><%if(blog.visibility){%>公开<%}else{%>隐私<%}%></td>
                <td>
                	<a href="/admin/del/<%=blog._id%>" onclick="if(confirm('是否确定删除?')) return true; else return false;">删除</a>|
                  <a href="/admin/upt/<%=blog._id%>">修改</a>|
                  <%if(blog.visibility){%><a href="/admin/close/<%=blog._id%>">关闭</a><%}else{%><a href="/admin/open/<%=blog._id%>">公开</a><%}%>
                </td>
              </tr>
            <%})%>
            </tbody>
          </table>
          </div>     
        <div class="panel-footer text-center">
        	 <ul class="pagination pagination-lg">
            <% if(page.pagenum <= 1){ %>
            <li class="disabled"><a href="javscript:void(-1);">&laquo;</a></li>
            <li class="disabled"><a href="javscript:void(-1);">上一页</a></li>
            <% }else{ %>
            <li><a href="/u/admin?p=1">&laquo;</a></li>
            <li><a href="/u/admin?p=<%=page.pagenum-1%>">上一页</a></li>
            <%}%>
            <% if(page.pagenum == page.pageCount || page.pageCount == 0){ %>
            <li class="disabled"><a href="javscript:void(-1);">下一页</a></li>
            <li class="disabled"><a href="javscript:void(-1);">&raquo;</a></li>
            <% }else{ %>
            <li><a href="/u/admin?p=<%=page.pagenum+1%>">下一页</a></li>
            <li><a href="/u/admin?p=<%=page.pageCount%>">&raquo;</a></li>
            <%}%>
            <li><h4 class="text-muted" style="line-height:35px">第<%=page.pagenum%>/<%=page.pageCount%>页-<%=page.total%>条记录</h4></li>
          </ul>
        </div>
        </div> <!-- ./end panel -->
      </div> <!-- ./end row -->
	 </div> <!-- ./end container -->
    </div> <!-- ./end wrap -->
    <%- include common/footer%>
  </body>
  </html>